﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Axe.ComponentModel
{
    public class PathCompactTypeConverter : TypeConverter
    {
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        {
            return destinationType == typeof(string);
        }

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            return Axe.FileSystem.PathCompactPath((string)value, 24);
        }
    }
}
